********************************************************************************
* Balyuk, Berger, and Hackney (2024)                                           *
* "What is Fueling FinTech Lending? The Role of Banking Market Structure"      *
* The Review of Corporate Financial Studies                                    *
********************************************************************************

clear all
clear matrix

******************************   Table IX   ************************************

* open file *

	use "$code\DATA_Prosper_annual_county_w.dta", clear

* large vs small bank lending *

	reghdfe Ysb1_P bank_access_l deposits_l log_pop_l ib6.rurality ///
		(large_bank2_P_f2 small_bank2_P_f2 = weighted_tier1_exp_large_f2 exam_small_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		replace stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l ib6.rurality ///
		(large_bank2_P_f2 small_bank2_P_f2 = weighted_tier1_exp_large_f2 exam_small_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality ///
		(large_bank2_P_f2 small_bank2_P_f2 = weighted_tier1_exp_large_f2 exam_small_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)	
	
* in-market vs out-of-market bank lending *
	
	reghdfe Ysb1_P bank_access_l deposits_l log_pop_l ib6.rurality ///
		(out_100_P_f2 in_100_P_f2 = out_market_tier1_exp_f2 in_market_exam_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l ib6.rurality ///
		(out_100_P_f2 in_100_P_f2 = out_market_tier1_exp_f2 in_market_exam_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality ///
		(out_100_P_f2 in_100_P_f2 = out_market_tier1_exp_f2 in_market_exam_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
* separate categories of bank lending *
		
	reghdfe Ysb1_P in_large2_100_P_f2 out_small2_100_P_f2 ///
		bank_access_l deposits_l log_pop_l ib6.rurality ///
		(out_large2_100_P_f2 in_small2_100_P_f2 = out_market_tier1_exp_large_f2 in_market_exam_small_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P in_large2_100_P_f2 out_small2_100_P_f2 ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l ib6.rurality ///
		(out_large2_100_P_f2 in_small2_100_P_f2 = out_market_tier1_exp_large_f2 in_market_exam_small_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P in_large2_100_P_f2 out_small2_100_P_f2 ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality ///
		(out_large2_100_P_f2 in_small2_100_P_f2 = out_market_tier1_exp_large_f2 in_market_exam_small_f2), ///
		absorb(fips year) cluster(fips) stages(first)
	outreg2 using "$code\Table_IX.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
